<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>test logowania</title>
    </h:head>

    <h:body>
        <div id="loginBack">
            <h:form id="loginForm" rendered="#{not identity.loggedIn}">
                <h:messages styleClass="error" />
                <h:panelGrid columns="2" >
                    <h:outputText value="Login" />
                    <h:inputText value="#{credentials.username}" />

                    <h:outputText value="Hasło" />
                    <h:inputSecret value="#{credentials.password}" />
                </h:panelGrid>

                <h:commandButton value="Wyślij" action="#{identity.login}" />
            </h:form>
            <h:outputText value="Jesteś zalogowany jako #{credentials.username}" rendered="#{identity.loggedIn}" />
        </div>
    </h:body>
</html>
